/**
 * CmpInstruction(a,b).act() => 
 * a=-1 if b<c
 * a=0  if b=c
 * a=1  if b>c
 * @author Patrik
 */

public class CmpInstruction implements InstructionInterface {

	IntWrapper param1;
	IntWrapper param2;
	IntWrapper param3;

	public CmpInstruction(IntWrapper a,IntWrapper b,IntWrapper c){
		param1=a;
		param2=b;
		param3=c;
	}

	@Override
	public Integer act() {
		if(param2.get()<param3.get()){
			param1.set(-1);
		}
		else if(param2.get()>param3.get()){
			param1.set(1);
		}
		else{
			param1.set(0);
		}
		return null;
	}
}